#include<bits/stdc++.h>
#define ll long long
#define mid ((l+r)>>1)
#define rep(x,y,z) for(int x=(y);x<=(z);x++)
#define per(x,y,z) for(int x=(y);x>=(z);x--)
#define repn(x) rep(x,1,n)
#define repm(x) rep(x,1,m)
#define pb push_back
#define e(x) for(int i=h[x],y=to[i];i;i=nxt[i],y=to[i])
#define E(x) for(auto y:p[x])
#define Pi pair<int,int>
#define ui unsigned ll
#define yy puts("Yes"),exit(0)
#define nn puts("No"),exit(0)
#define YY return puts("Yes"),void()
#define NN return puts("No"),void()
inline int read(){int s=0,w=1;char c=getchar();while(c<48||c>57) {if(c=='-') w=-1;c=getchar();}while(c>=48&&c<=57)s=(s<<1)+(s<<3)+c-48,c=getchar();return s*w;}
inline void pf(int x){if(x<0) putchar('-'),x=-x;if(x>9)pf(x/10);putchar(x%10+48);}
using namespace std;
const int N=2e5+5,M=1e6+5,inf=(1LL<<30)-1,mod=1e9+7;
const ll llf=1e18;
const double eps=1e-6;
inline void add(int &a,int b){if(b<0)b+=mod;((a+=b)>=mod) and (a-=mod);}
inline int Add(int a,int b){return add(a,b),a;}
inline int mul(int a,int b){add(b,mod);return 1LL*a*b%mod;}
inline void Mul(int &a,int b){a=mul(a,b);}
inline void red(int &a,int b){add(a,mod-b);}
inline int Red(int a,int b){return red(a,b),a;}
inline int qp(int a,ll b){if(!b)return 1;int c=qp(a,b>>1LL);Mul(c,c);if(b&1)Mul(c,a);return c;}
inline int INV(int x){return qp(x,mod-2);}
inline bool che(int x,int p){return (x>>p)&1LL;}
int n,a[N],p[N];
double ans;
inline bool check(double lim){
	repn(i)p[i]=i;
	do{
		double L=0,R=0,nxL,nxR;
		bool fl=1;
		repn(i){
			double D=a[p[i]];
			nxL=L+D,nxR=R+D;
			if(L>=D){
				nxL=L-D;
			}else {
				if(R>=D)nxL=0;
				else nxL=D-R;
			}
			L=nxL,R=min(lim,nxR);
			if(L>R+eps){
				fl=0;
				break;
			}
		}
		if(!fl)continue;
		fl&=L<=eps;
		if(fl)return 1;
		
	}while(next_permutation(p+1,p+n+1));
	return 0;
}
inline void subtask1(){
	bool fl=0;
	double l=1,r=10000000;
	int T=50;
	while(T--){
		double md=(l+r)/2.0;
		if(check(md))ans=md,fl=1,r=md-eps;
		else l=md+eps;
	}
	if(!fl)return puts("-1"),void();

	printf("%.5lf\n",ans);
	repn(i)puts("0 0");
}
inline void Main(){
	n=read();
	repn(i)a[i]=read();
	if(n<=10)return subtask1();
	puts("-1");
}
signed main(){
	freopen("manhattan.in","r",stdin);
	freopen("manhattan.out","w",stdout);
	int T=1;
	while(T--)Main();
	return 0;
}
